Many types of electronic circuits, such as battery chargers, use current supplies with a user programmable output current. Generally, a user connects a resistor to a current set pin or terminal, and the size of the resistor establishes the output current level. The user selectable resistor controls the current flow through the current set terminal, and the output current is proportional to the current through the current set pin.
One problem with having an externally programmable current level is that if the current set pin is shorted, the current supply can run away with excessive output current levels. This is particularly problematic in a battery charger. Excessive currents to a battery can damage the battery. One solution to this problem is to test the current set pin during startup of the current supply by sourcing a test current to the current set pin to detect whether the current set pin is shorted. However, this approach operates only during startup and does not detect shorts that occur during operation. Furthermore, this approach requires an extra circuit to generate the test current.